package com.atguigu.tingshu.controller;

import com.atguigu.tingshu.entity.AlbumStat;
import com.atguigu.tingshu.result.Result;
import com.atguigu.tingshu.service.AlbumStatService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/album/stat")
@CrossOrigin
public class AlbumStartController {
    @Autowired
    private AlbumStatService albumStatService;


    /*
       查询统计数据列表的页面
    */
    @CrossOrigin
    @GetMapping("list/{pageNum}/{pageSize}")
    public Result<Page<AlbumStat>> listPage(@PathVariable("pageNum")Long pageNum,
                                            @PathVariable("pageSize")Long pageSize ){
        return Result.success(albumStatService.page(new Page<>(pageNum,pageSize)));
    }
}
